﻿using System;
using System.Collections.Generic;
using LPTask.Interfaces;
using LPTask.Interfaces.Presenters;
using LPTask.Interfaces.Views;
using LPTask.Presenters;
using LPTask.UI;

namespace LPTask
{
    internal static class Program
    {
        private static IViewManager _viewManager;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main()
        {
            _viewManager = WinFormsViewManager.Instance;
            IGeneralPresenter presenter = CreateGeneralPresenterView();
            presenter.Activate();
        }

        private static IGeneralPresenter CreateGeneralPresenterView()
        {
            IGeneralView view = _viewManager.GeneralView;
            IGeneralPresenter presenter = new GeneralPresenter(view);
            presenter.TaskPresenters = CreatePresenters().AsReadOnly();
            IResultView resultView = _viewManager.CreateResultView();
            presenter.ResultPresenter = new ResultPresenter(resultView);
            return presenter;
        }

        private static List<ITaskPresenter> CreatePresenters()
        {
            var presenters = new List<ITaskPresenter>();
            
            return presenters;
        }
    }
}